<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>ftp插件信息配置表列表</title>
<link href="../../static/plugin/easyui/themes/bootstrap/easyui.css"
	rel="stylesheet" type="text/css" />
<link href="../../static/plugin/easyui/themes/icon.css" rel="stylesheet"
	type="text/css" />
<script src="../../static/plugin/easyui/jquery.min.js"
	type="text/javascript"></script>
<script src="../../static/plugin/easyui/jquery.easyui.min.js"
	type="text/javascript" charset="utf-8"></script>
<script src="../../static/plugin/easyui/locale/easyui-lang-zh_CN.js"
	type="text/javascript"></script>
<script src="../../static/plugin/assets/jslib.util.js"
	type="text/javascript"></script>
<script src="../../static/plugin/assets/jslib.jquery.ajax.js"
	type="text/javascript"></script>
<script src="../../static/plugin/assets/jslib.easyui.util.js"
	type="text/javascript"></script>
<script src="../../ffres/dict/all.js" type="text/javascript"></script>
<a href="" target="_blank" id="commonLink" name="commonLink"></a>
</head>
<script type="text/javascript">
	var pluginConfId = "";

	$(function() {
		$("#dg").datagrid({
			singleSelect : true,
			collapsible : true,
			url : '../../api/plugin/ftp/confs',
			method : 'post',
			queryParams : {
				pluginConfId : $.getUrlParam('pluginConfId')
			},
			toolbar : '#tb',
			rownumbers : "true",
			pagination : "true",
			pageSize : "20"
		});
	});

	function doAdd() {
		JLEUtil.createModalWin('新增', 'PluginFtpConfAdd.html?pluginConfId='+$.getUrlParam('pluginConfId'));
	}

	function doUpdate() {
		var row = $('#dg').datagrid('getSelected');
		if (row) {
			JLEUtil.createModalWin('修改', 'PluginFtpConfUpdate.html?'
					+ 'pluginConfId=' + row.pluginConfId + '&confSort='
					+ row.confSort);
		} else {
			$.messager.alert('提示', '请选择一条记录！', 'info');
		}
	}

	function doDelete() {
		var row = $('#dg').datagrid('getSelected');
		if (row) {
			$.messager.confirm('删除提示', '你确定要删除这条记录?', function(r) {
				if (r) {
					var jsonData = JSON.parse('{' + '"pluginConfId":"'
							+ row.pluginConfId + '"' + ',' + '"confSort":"'
							+ row.confSort + '"' + '}');
					$.restfulDelete('../../api/plugin/ftp/conf', jsonData,
							function(data) {
								$.messager.alert('提示', '记录删除成功!', 'info');
								$('#dg').datagrid('reload');
							});
				}
			});
		} else {
			$.messager.alert('提示', '请选择一条记录！', 'info');
		}
	}

	function doView() {
		var row = $('#dg').datagrid('getSelected');
		if (row) {
			JLEUtil.createModalWin('详情', 'PluginFtpConfView.html?'
					+ '&pluginConfId=' + row.pluginConfId + '&confSort='
					+ row.confSort);
		} else {
			$.messager.alert('提示', '请选择一条记录！', 'info');
		}
	}

	function reloadList() {
		$('#dg').datagrid('reload');
		JLEUtil.closewin();
	};
</script>
</head>
<body class="easyui-layout">
	<div data-options="region:'north',title:''"
		style="height: 40px; background: #F4F4F4;">
		<form id="searchForm">
			<table>
				<tr>
					<td>&nbsp;地址：</td>
					<td><input name="sftpServerIp" id="sftpServerIp" /></td>
					<td><a class="easyui-linkbutton" href="javascript:void(0);"
						onclick="JLEUtil.queryForm('searchForm','dg','../../api/plugin/ftp/confs');">查找</a></td>
					<td><a class="easyui-linkbutton" href="javascript:void(0);"
						onclick="JLEUtil.clearForm('searchForm');">清空</a></td>
				</tr>
			</table>
		</form>
	</div>
	<div data-options="region:'center',split:false">
		<table id="dg" class="easyui-datagrid" title=""
			style="width: 100%; height: 100%">
			<thead>
				<tr>
					<th data-options="field:'confSort',resizable:true">配置顺序</th>
					<th data-options="field:'pluginConfId',resizable:true">配置标识符</th>
					<th data-options="field:'serverType',resizable:true" formatter="formatter_FILE_SERVER_TYPE">连接服务类型</th>
					<th data-options="field:'sftpServerIp',resizable:true">地址</th>
					<th data-options="field:'ftpServerPort',resizable:true">端口</th>
					<th data-options="field:'ftpServerUser',resizable:true">用户名</th>
					<th data-options="field:'ftpServerPwd',resizable:true">密码</th>
					<th data-options="field:'loadType',resizable:true" formatter="formatter_FILE_OPT_TYPE">操作类型</th>
					<th data-options="field:'ftpFilePath',resizable:true">服务器文件路径</th>
					<th data-options="field:'remoteFileName',resizable:true">服务器文件名称</th>
					<th data-options="field:'localFilePath',resizable:true">本地路径</th>
					<th data-options="field:'localFileName',resizable:true">本地文件名称</th>
				</tr>
			</thead>
		</table>
	</div>
	<div id="tb" style="padding: 1px">
		<div style="margin-bottom: 2px">
			<a href="javascript:doAdd()" class="easyui-linkbutton"
				iconCls="icon-add" plain="true">新增</a> <a
				href="javascript:doUpdate()" class="easyui-linkbutton"
				iconCls="icon-edit" plain="true">修改</a> <a
				href="javascript:doDelete()" class="easyui-linkbutton"
				iconCls="icon-remove" plain="true">删除</a> <a
				href="javascript:doView()" class="easyui-linkbutton"
				iconCls="icon-ok" plain="true">查看</a>
		</div>
	</div>
</body>
</html>
